package com.training.java.core.collections.laptop.post15;

import java.util.HashSet;
import java.util.Set;

import com.training.java.core.collections.laptop.pre15.Laptop;

public class LaptopHashSetDemo {

	public static void main(String[] args)
	{
		Laptop laptop1= new Laptop("Hp","pavillion","intel core");
		Laptop laptop2= new Laptop("Dell","inspiron","Quad core");
		Laptop laptop3= new Laptop("Acer","aspire","Dual core");
		Laptop laptop4= new Laptop();
		Laptop laptop5= new Laptop("Acer","aspire","Dual core");
		
		laptop1.setOs("windows");
		laptop2.setOs("Linux");
		laptop3.setOs("Mac");
		laptop5.setOs("Windows");
		
		Set<Laptop> setOfLaptops = new HashSet<Laptop>();
		
		setOfLaptops.add(laptop1);
		setOfLaptops.add(laptop2);
		setOfLaptops.add(laptop3);
		setOfLaptops.add(laptop4);
		setOfLaptops.add(laptop5);
		setOfLaptops.add(laptop1);
		
		
		
		for (Laptop laptop:setOfLaptops)
		{
			System.out.println("Laptop's company: " + laptop.getCompany());
			System.out.println("Laptop's model: " + laptop.getModel());
			System.out.println("Laptop's os: " + laptop.getOs());
			System.out.println("Laptop's processor: " + laptop.getProcessor());
			System.out.println("*****************");
		}
			System.out.println("Are laptop 3 and laptop 5 equal ?: " + laptop3.equals(laptop5));
		
	}

}
